package fz.vrd.app.toast_dialog;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;


import fz.vrd.app.R;
import fz.vrd.library.page.activity.BaseAc;
import fz.vrd.ui.toast.ToastFactory;

public class ToastAc extends BaseAc implements View.OnClickListener {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_toast);
        getSupportActionBar().setTitle("toast");

        findViewById(R.id.btn_sys).setOnClickListener(this);
        findViewById(R.id.btn_nomal).setOnClickListener(this);
        findViewById(R.id.btn_success).setOnClickListener(this);
        findViewById(R.id.btn_warm).setOnClickListener(this);
        findViewById(R.id.btn_error).setOnClickListener(this);
        findViewById(R.id.btn_self).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {

        switch (view.getId()) {

            case R.id.btn_sys:
                ToastFactory.getInstance().showSys(page.getContext(), "toast");
                break;

            case R.id.btn_nomal:
                ToastFactory.getInstance().showNomal(page.getContext(), "toast");
                break;

            case R.id.btn_success:
                ToastFactory.getInstance().showSuccess(page.getContext(), "toast");
                break;

            case R.id.btn_warm:
                ToastFactory.getInstance().showWarm(page.getContext(), "toast");
                break;

            case R.id.btn_error:
                ToastFactory.getInstance().showError(page.getContext(), "toast");
                break;

            case R.id.btn_self:
                ToastFactory.getInstance().show(page.getContext(), "自定义", fz.vrd.ui.R.mipmap.lib_ui_toast_default, R.color.colorAccent, fz.vrd.ui.R.drawable.lib_ui_shape_bg_blue);
                break;
        }
    }
}
